package com.big.pay.listener;

import com.big.common.result.ResultCodeEnum;
import com.big.model.model.pay.PayLog;
import com.big.order.OrderFeignClient;
import com.big.pay.config.RabbitConfig;
import com.big.pay.service.PayLogService;
import com.rabbitmq.client.Channel;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class OrderStatusListener {

    @Autowired
    OrderFeignClient orderFeignClient;


    //监听订单
    @RabbitListener(queues = RabbitConfig.QUEUE_ORDER_STATUS_ITEM)
    public void onOrderStatus(String oId , Channel channel , Message message){

        orderFeignClient.updateOrder(oId, ResultCodeEnum.PAY_THEN);//已支付

    }

}
